package org.example.controller;

import org.example.entity.Room;
import org.example.service.RoomDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@RestController
public class RoomController {

    @Autowired
    private RoomDao roomDao;

    @GetMapping("/room/list")
    public Map list(){
        List list = roomDao.list();
        Map map = new HashMap();
        map.put("data", list);
        return map;
    }
}
